package com.jcnet.bizaia.tools;

import java.io.Serializable;
import java.util.List;

import com.jcnet.bizaia.bean.VoiceDetailBean;
import com.jcnet.bizaia.service.JCMusicPlayerService;

import android.content.Context;
import android.content.Intent;

public class MusicTools {
	
	
	public static void musicPlay(Context context){
		context.sendBroadcast(new Intent(JCMusicPlayerService.MUSIC_PLAY));
	}
	public static void musicPause(Context context){
		context.sendBroadcast(new Intent(JCMusicPlayerService.MUSIC_PAUSE));
	}
	public static void musicNext(Context context){
		context.sendBroadcast(new Intent(JCMusicPlayerService.MUSIC_NEXT));
	}
	
	public static void musicPrevious(Context context){
		context.sendBroadcast(new Intent(JCMusicPlayerService.MUSIC_PREVIOUS));
	}
	public static void musicSetPlayList(Context context,List<VoiceDetailBean> musicBeans,int postion){
		Intent intent = new Intent(JCMusicPlayerService.MUSIC_SET_LIST);
		intent.putExtra(JCMusicPlayerService.LIST_DATA,(Serializable) musicBeans);
		intent.putExtra(JCMusicPlayerService.LIST_POSTION, postion);
		context.sendBroadcast(intent);
	}
	
	
	
	
	public static String getFomatTime(int current){
		
		//  格式如   01:30
		
		return (current%3600/60<10?0+""+current%3600/60:current%3600/60)+":"+(current%60<10?0+""+current%60:current%60);
	}
	
	
	
}
